using System;
using System.Net;

namespace BuildBox.Core.Server.Adapters
{
    public interface IHttpListenerRequestAdapter
    {
        string HttpMethod { get; }
        Uri Url { get; }
        IConfiguration Configuration { get; }
    }

    public class HttpListenerRequestAdapter : IHttpListenerRequestAdapter
    {
        private readonly HttpListenerRequest _request;

        public HttpListenerRequestAdapter(HttpListenerRequest request, IConfiguration configuration)
        {
            _request = request;
            Configuration = configuration;
        }

        public string HttpMethod
        {
            get { return _request.HttpMethod; }
        }

        public Uri Url
        {
            get { return _request.Url; }
        }

        public IConfiguration Configuration { get; private set; }
    }
}